package com.example.seckill.service;

import com.example.seckill.domain.ItemDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.seckill.service.model.ItemModel;

import java.util.List;

/**
 *
 */
public interface ItemService extends IService<ItemDO> {

    /**
     * 创建商品
     */
    ItemModel insert(ItemModel itemModel);

    /**
     * 查找单个商品
     */
    ItemModel findById(Integer id);

    /**
     * 查找所有商品
     */
    List<ItemModel> findAll();

    Boolean decreaseStock(Integer itemId, Integer amount);

    void increaseSales(Integer itemId, Integer amount);
}
